Skip to content

Switch out download files for Species full name#1547

Merged
oblodgett merged 1 commit intostagefrom
SCRUM-5953
Apr 1, 2026
Merged

Switch out download files for Species full name#1547
oblodgett merged 1 commit intostagefrom
SCRUM-5953

Conversation

@oblodgett
Copy link
Copy Markdown
Member

No description provided.

@oblodgett oblodgett requested a review from a team as a code owner April 1, 2026 19:56
@claude
Copy link
Copy Markdown

claude bot commented Apr 1, 2026

Code Review

Summary: This PR consistently replaces getTaxon().getName() with getTaxon().getSpecies().getFullName() across 8 files to use species full name in downloads and API responses. The change is mechanical and the intent is clear.

Potential NullPointerException risk (medium severity):

The new call chain getTaxon().getSpecies().getFullName() adds an extra dereference. Existing indexer code in DiseaseAnnotationCurationIndexer.java explicitly null-checks getSpecies() (lines 207 and 415):

if (gene.getTaxon().getSpecies() != null) {
    gdad.setPhylogeneticSortingIndex(gene.getTaxon().getSpecies().getPhylogeneticOrder());
}

This confirms getSpecies() can return null. None of the call sites in this PR guard against that. If a record has a taxon but no associated species, each of these locations will throw an NPE at runtime:

  • ExpressionRibbonESService.java:156
  • DiseaseAnnotationToTdfTranslator.java:194, 200, 206
  • AlleleToTdfTranslator.java:166
  • ExpressionToTdfTranslator.java:62
  • GeneGeneticInteractionToTdfTranslator.java:59
  • GeneMolecularInteractionToTdfTranslator.java:59
  • VariantSearchResultConverter.java:35 (already checks getTaxon() != null but not getSpecies())

Suggestion: Add null checks for getSpecies(), or if species is guaranteed non-null for all records reaching these code paths, document that assumption. The VariantSearchResultConverter is the easiest to fix since it already has a null-guard pattern — just extend it:

if (variantLocation.getVariantAssociationSubject().getTaxon() != null
    && variantLocation.getVariantAssociationSubject().getTaxon().getSpecies() != null) {

Everything else (logic, test updates, import reordering) looks correct.

@oblodgett oblodgett merged commit 802c5a2 into stage Apr 1, 2026
5 checks passed
@oblodgett oblodgett deleted the SCRUM-5953 branch April 1, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants